import './utils/utils'
import './utils/http'
// app.js
App({
  token: '',
  refreshToken: '',
  avatar: '',
  nickName: '',

  onLaunch () {
    this.getToken()
  },
  getToken () {
    this.token = wx.getStorageSync('token')
    this.refreshToken = wx.getStorageSync('refreshToken')
  },

  setToken (key, token) {
    // 将 token 记录在应用实例中
    this[key] = token
    // 将 token 存入本地
    wx.setStorageSync(key, token)
  },

  //设置用户信息
  getUserInfo (key, info) {
    this[key] = info
  }
})
